package com.abel.bigwater.dataserver.model.kming

enum class KmingChannelType(val code: Int, val len: Short, val fmt: Class<*>, val desc: String, val memo: String) {
    MeterFlow(0x1113, 4, Float::class.java, "水表瞬时流量", "单位 m³/h"),

    MeterForwardFloat(0x1213, 4, Float::class.java, "水表正向累计流量", "单位 m"),
    MeterForwardInt(0x1214, 4, Int::class.java, "水表正向累计流量", "单位 m"),
    MeterForwardDouble(0x1215, 8, Double::class.java, "水表正向累计流量", "单位 m"),
    MeterForwardIntShort(0x1216, 4 + 2, Int::class.java, "水表正向累计流量", "单位 m"),

    MeterRevertFloat(0x1313, 4, Float::class.java, "水表反向累计流量", "单位 m³"),
    MeterRevertInt(0x1314, 4, Int::class.java, "水表反向累计流量", "单位 m³"),
    MeterRevertDouble(0x1315, 8, Double::class.java, "水表反向累计流量", "单位 m³"),
    MeterRevertIntShort(0x1316, 4 + 2, Int::class.java, "水表反向累计流量", "单位 m³"),

    MeterNetFloat(0x1413, 4, Float::class.java, "水表净累计流量", "单位 m³"),
    MeterNetInt(0x1414, 4, Int::class.java, "水表净累计流量", "单位 m³"),
    MeterNetDouble(0x1415, 8, Double::class.java, "水表净累计流量", "单位 m³"),
    MeterNetIntShort(0x1416, 4 + 2, Int::class.java, "水表净累计流量", "单位 m³"),

    MeterPressureFloat(0x2113, 4, Float::class.java, "压力值", "单位 MPa");

    companion object {
        fun findByCode(code: Int) = values().find { it.code == code }
    }
}